﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Text;
using WebApiV3.Interface.Log;
using WebApiV3.Utils.Log;

namespace WebApiV3.Utils.Filters
{
    public class GlobalExceptionFilter : IExceptionFilter
    {

        private readonly ILog _log;

        public GlobalExceptionFilter (ILog log)
        {
            _log = log;
        }
        public void OnException(ExceptionContext context)
        {
            _log.Error(context.Exception);
        }
    }
}
